<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="utf-8"%>
<%@ include file="/website/layout/tag.jsp"%>
<script type="text/javascript">
	$(document).ready(
		function() {
			//事件注册.
			$("#searchBtn").click(searchMember);
			$("#modifyBtn").click(modifyMember);
			$("#serviceBtn").click(joinService);
			$("#showStopBtn").click(showStopDlg);
			$("#stopBtn").click(stopMember);
			$("#cancelStopBtn").click(cancelStop);
			
			//checkbox控件事件注册.
			$("[name='chkAll']").each(
				function() {
					$(this).click(function() {
						checkAll("chkAll", "chkEach");
					});
				}
			);
			$("[name='chkEach']").each(
				function() {
					$(this).click(function() {
						checkEach("chkAll", "chkEach");
					});
				}
			);
			
			//设置左菜单对应菜单CSS为选中状态.
			changeToActiveCss("menu_6010");
			
			//消息显示.
			var msg = '<c:out value="${msg}"/>';
			if (msg != "") {
				alert(msg);
			}
		}
	);
	
	function modifyMember() {
		var checkObjs = $(":checkbox[name='chkEach']:checked");
		var len = checkObjs.length;
		if (len == 0) {
			alert("请选择要编辑的会员.");
			return false;
		}
		
		if (len > 1) {
			alert("请只选择一条会员.");
			return false;
		}
		
		window.location.href='${pageContext.request.contextPath}/member/enterMemberModify.do?oper=modify&sysId=' + checkObjs[0].value;
	}
	
	function joinService() {
		var checkObjs = $(":checkbox[name='chkEach']:checked");
		var len = checkObjs.length;
		if (len == 0) {
			alert("请选择要续费的会员.");
			return false;
		}
		
		if (len > 1) {
			alert("请只选择一条会员.");
			return false;
		}
		
		window.location.href='${pageContext.request.contextPath}/member/enterServiceJoin.do?sysId=' + checkObjs[0].value;
	}
	
	function searchMember() {
		$("#searchForm").submit();
	}
	
	function showStopDlg() {
		var checkObjs = $(":checkbox[name='chkEach']:checked");
		var len = checkObjs.length;
		if (len == 0) {
			alert("请选择要屏蔽的会员.");
			return false;
		}
		
		if (len > 1) {
			alert("请只选择一条会员.");
			return false;
		}
		
		$("#sysId").val(checkObjs[0].value);
		$("#stopDlg").show().css("top",($(document).height()-140)/2 ).css("left",($(document).width()-400)/2 );
	}
	
	function cancelStop() {
		$("#stopLog").val("");
		$("#stopDlg").hide()
	}
	
	function stopMember() {
		$("#stopLog").val($("#stopLogInput").val());
		$("#searchForm").attr("action", "${pageContext.request.contextPath}/member/stopMember.do");
		$("#searchForm").submit();
	}
</script>
	
<div id="content_right">
	<div style="width:100%;height:35px;line-height:35px;text-align:left;background-color:#F5FAFA;font-weight:bold; ">会员 > 会员管理 > 编辑会员</div>
	<div id="searchArea">
		<table width="100%" cellspacing="0">
			<tr>
				<td width="60px" align="right">用户ID:</td>
				<td width="120px" align="left">
				</td>
				<td width="60px" align="right">会员名:</td>
				<td width="120px" align="left">
				</td>
				<td width="60px" align="right">电子邮件:</td>
				<td width="120px" align="left">
				</td>
				<td width="60px" align="right">联系电话:</td>
				<td width="120px" align="left">
				</td>
				<td></td>
			</tr>
			<tr>
				<td align="right">注册日期:</td>
				<td align="left" colspan="3">
					<input type="text" style="width:60px; " name="testInput" value=""/>&nbsp;-&nbsp;<input type="text" style="width:60px; " name="testInput" value=""/>&nbsp;(YYYYMMDD)
				</td>
				<td align="right">地区:</td>
				<td align="left" colspan="4">
					<select style="width:80px ">
						<option value="1" selected>全部</option>
						<option value="2">郴州市</option>
						<option value="3">北京市</option>
					</select>
					<select style="width:80px ">
						<option value="1" selected>全部</option>
						<option value="2">苏仙区</option>
						<option value="3">北湖区</option>
					</select>
					<select style="width:80px ">
						<option value="1" selected>全部</option>
						<option value="2">苏仙区</option>
						<option value="3">北湖区</option>
					</select>
					<select style="width:80px ">
						<option value="1" selected>全部</option>
						<option value="2">苏仙区</option>
						<option value="3">北湖区</option>
					</select>
				</td>
			</tr>
			<tr>
				<td colspan="9">
					<div class="buttons" style="float:right; margin-right:40px;">
						<a id="searchBtn" href="#">
							<img src="../images/btn_search.gif" alt=""/> 
							检索
						</a>
					</div>
				</td>
			</tr>
		</table>
	</div>
	<div id="btnArea">
		<div class="buttons">
			<a id="modifyBtn" href="#">
				<img src="../images/btn_search.gif" alt=""/> 
				编辑会员
			</a>
			
			<a id="serviceBtn" href="#" style="margin-left:25px;">
				<img src="../images/btn_apply.png" alt=""/> 
				缴续费
			</a>
			<a id="showStopBtn" href="#">
				<img src="../images/btn_cross.png" alt=""/> 
				加入黑名单
			</a>
		</div>
	</div>
	<!--Stop member dialog start-->
	<div id="stopDlg" class="divDlg" style="display:none; width:400px;height:140px; ">
		<div class="header">会员屏蔽</div>
		<div style="margin-top:10px; ">
			<table>
				<tr>
					<th>屏蔽理由：</th>
					<td>
						<input type="text" id="stopLogInput" name="stopLogInput" value="" style="width:300px;" maxlength="50"/>
					</td>
				</tr>
			</table>
			<div class="buttons" style="margin-top:30px;margin-left:5px;">
				<a id="stopBtn" href="#">
					<img src="../images/btn_apply.png" alt=""/> 
					保存
				</a>
				<a id="cancelStopBtn" href="#">
					<img src="../images/btn_cross.png" alt=""/> 
					取消
				</a>
			</div>
		</div>
	</div>
	<!--Stop member dialog end-->
	<div style="clear:both; "></div>
	<div id="resultArea" style="height:400px; ">
		<table class="dataTable" cellspacing="0"> 
			<tr> 
				<th scope="col" width="26px;"><input type="checkbox" name="chkAll"/></th> 
				<th scope="col" width="85px">用户ID</th> 
				<th scope="col" width="65px">会员名</th> 
				<th scope="col" width="90px">电子邮件</th> 
				<th scope="col" width="75px">手机</th> 
				<th scope="col" width="75px">电话</th>
				<th scope="col" width="120px">注册日期</th> 
				<th scope="col" >注册IP</th>
				<th scope="col" width="310px">地址</th> 
			</tr> 
			<tr> 
				<td class="row"> <input type="checkbox" name="chkEach" value="#"/></td>
				<td class="row">#</td> 
				<td class="row">#</td> 
				<td class="row">#</td> 
				<td class="row">#</td> 
				<td class="row">#</td> 
				<td class="row">#</td>
				<td class="row">#</td>
				<td class="row">郴州市苏仙区橘井路卧龙大院6-11</td>
			</tr>
		</table> 
	</div>
</div>

